/****************************************************************************
**
** Copyright (C) 2007-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** Licensees holding a valid Qt License Agreement may use this file in
** accordance with the rights, responsibilities and obligations
** contained therein.  Please consult your licensing agreement or
** contact sales@trolltech.com if any conditions of this licensing
** agreement are not clear to you.
**
** Further information about Qt licensing is available at:
** http://www.trolltech.com/products/qt/licensing.html or by
** contacting info@trolltech.com.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#include <QTextCodec>
#include <QLabel>
#include "browserapplication.h"

int main(int argc, char **argv)
{
    Q_INIT_RESOURCE(data);

    BrowserApplication application(argc, argv);
    if (!application.isTheOnlyBrowser())
        return 0;
    // the codes below is to solve the Chinese messy code

    QTextCodec *codec = QTextCodec::codecForName("utf8");
    QTextCodec::setCodecForLocale(codec);
    QTextCodec::setCodecForCStrings(codec);
    QTextCodec::setCodecForTr(codec);

    // the codes upon above is to solve the Chinese messy code

    // set the font
    // 如果没有设置字体的话，在运行的时候需要加参数 -font wenquanyi
    // 如果既没有设置字体，又没有加参数的话，就不能加载中文内容，只能加载英文和数字
    // 很奇怪，不明白!!!!!!!!!!!
    QFont font("wenquanyi",12,QFont::Normal); //使用wenquanyi字体
    application.setFont(font);

    application.newMainWindow();

    return application.exec();
}

